// 弹性布局
@mixin flex-center($direction: row) {
    display: flex;
    flex-direction: $direction;
    justify-content: center;
    align-items: center;
  }
  
  @mixin flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  // 文字截断
  @mixin text-ellipsis($line: 1) {
    @if $line == 1 {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    } @else {
      display: -webkit-box;
      -webkit-line-clamp: $line;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
  }
  
  // 定位
  @mixin absolute-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  @mixin fixed-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  // 响应式断点
  @mixin respond-to($breakpoint) {
    @if $breakpoint == phone {
      @media (max-width: 600px) { @content; }
    }
    @else if $breakpoint == tablet {
      @media (max-width: 900px) { @content; }
    }
    @else if $breakpoint == desktop {
      @media (min-width: 1200px) { @content; }
    }
  }
  
  // 阴影
  @mixin box-shadow($level: 1) {
    @if $level == 1 {
      box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    } @else if $level == 2 {
      box-shadow: 0 3px 6px rgba(0,0,0,0.16);
    } @else if $level == 3 {
      box-shadow: 0 10px 20px rgba(0,0,0,0.19);
    }
  }
  
  // 按钮重置
  @mixin button-reset {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
  }
  
  // 三角形箭头
  @mixin arrow($direction: top, $size: 6px, $color: #000) {
    width: 0;
    height: 0;
    border-style: solid;
  
    @if $direction == top {
      border-width: 0 $size $size $size;
      border-color: transparent transparent $color transparent;
    } @else if $direction == bottom {
      border-width: $size $size 0 $size;
      border-color: $color transparent transparent transparent;
    } @else if $direction == left {
      border-width: $size $size $size 0;
      border-color: transparent $color transparent transparent;
    } @else if $direction == right {
      border-width: $size 0 $size $size;
      border-color: transparent transparent transparent $color;
    }
  }